Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

feat(css): allow the css prop to accept fns and strings #171

Merged
merged 1 commit into from
Jun 12, 2017

Conversation

kentcdodds
Copy link
Contributor

@kentcdodds kentcdodds commented Jun 9, 2017

What: Closes #170

Why: enables code reuse and potentially "Ahead of Time compilation"

How:

  • Reusing the same logic for cssOverrides as we use for
    styles in get-glamor-classname.js. Tiny refactor there.
  • Adding tests to cover all the cases for the API.

Checklist:

  • Documentation
  • Tests
  • Code complete
  • Added myself to contributors table N/A
  • Followed the commit message format

I also updated deps because I think prettier was messed up.

@codecov-io
Copy link

codecov-io commented Jun 9, 2017

Codecov Report

Merging #171 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #171   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          10     10           
  Lines         139    142    +3     
  Branches       35     35           
=====================================
+ Hits          139    142    +3
Impacted Files Coverage Δ
src/get-glamor-classname.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 844d2af...d91e9a4. Read the comment docs.

@kentcdodds kentcdodds force-pushed the pr/css-as-function branch from acfe0c2 to 6bbb9c3 Compare June 9, 2017 22:54
**What**: Closes #170

**Why**: enables code reuse and potentially "Ahead of Time compilation"

**How**:

- Reusing the same logic for `cssOverrides` as we use for
`styles` in `get-glamor-classname.js`. Tiny refactor there.
- Adding tests to cover all the cases for the API.
@kentcdodds kentcdodds force-pushed the pr/css-as-function branch from 6bbb9c3 to d91e9a4 Compare June 9, 2017 22:55
@@ -4,16 +4,13 @@ const glamorous = glamorousStar.default

Object.assign(
glamorous,
Object.keys(glamorousStar).reduce(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier update. I didn't change anything here

Copy link
Contributor

@kkemple kkemple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Interested to see what you have in store for ahead of time compilation. 😄

Copy link
Collaborator

@luke-john luke-john left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a handy addition, we'll likely make use of this almost immediately once it lands.

@kentcdodds kentcdodds merged commit b248049 into master Jun 12, 2017
@kentcdodds kentcdodds deleted the pr/css-as-function branch June 12, 2017 12:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow css prop to accept a function
4 participants